package com.foreknow.view;

import com.foreknow.model.User;
import com.foreknow.service.UserService;
import com.foreknow.service.impl.UserServiceImpl;

import java.util.List;

public class TestUserService {
  public static void main(String[] args) {
    UserService service = new UserServiceImpl() ;
    //查询所有用户信息
    List<User> list = service.getAll();
    for (User user:list) {
      System.out.println(user.getId()+"--"+user.getUsername());
    }
//    boolean isRigth = service.del(2);
//    if(isRigth){
//      System.out.println("delete success......");
//    }else {
//      System.out.println("delete error......");
//    }
//    User user = new User();
//    user.setUsername("test");
//    user.setPassword("test123456");
//
//    boolean isRigth = service.save(user);
//    if(isRigth){
//      System.out.println("添加成功......");
//    }else {
//      System.out.println("添加失败......");
//    }

  }
}
